import CSelectFormItem from '@/components/CSelectFormItem/CSelectFormItem'
import useEffectUserPage from '@/useEffect/useEffectUserPage'
import { Form } from '@douyinfe/semi-ui'
import { OptionProps } from '@douyinfe/semi-ui/lib/es/select'

// 获取 下拉选的数据
export function getBulletinSearchFormSelectData(modalVisible: boolean) {
  const { userList } = useEffectUserPage(modalVisible, true)
  return { userList }
}

interface IBulletinSearchFormItem {
  dictList: OptionProps[]
  userList: OptionProps[]
}

export default function BulletinSearchFormItem(props: IBulletinSearchFormItem) {
  return (
    <>
      <CSelectFormItem
        field="type"
        label="公告类型"
        optionList={props.dictList}
      ></CSelectFormItem>
      <Form.Input field="title" showClear label="标题" />
      <Form.Input field="content" showClear label="公告内容" />
      <Form.DatePicker
        field="sendTimeList"
        label="发布时间"
        type="dateTimeRange"
      />
      <CSelectFormItem
        field={'createId'}
        label={'创建人'}
        optionList={props.userList}
      />
      <CSelectFormItem
        field={'status'}
        label={'公告状态'}
        optionList={[
          { label: '草稿', value: 1 },
          { label: '正式', value: 2 },
        ]}
      />
      <Form.Input field="xxlJobId" showClear label="xxlJobId" />
      <Form.Input field="remark" showClear label="备注" />
    </>
  )
}
